/**
 * Copyright (C), 2016-2019
 * FileName: FtlController
 * Author:   yacnog_liu
 * Date:     2019/4/5 11:14
 * Description:
 */
package com.mayi.bootdemo.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Controller
public class FtlController {

    @RequestMapping("/showUser")
    public String showUser(Model model) {
        List<Map<String, Object>> list = new ArrayList<Map<String, Object>>();
        Map map1 = new HashMap();
        map1.put("name", "张三");
        map1.put("age", "20");
        map1.put("sex", "0");

        Map map2 = new HashMap();
        map2.put("name", "李白");
        map2.put("age", "22");
        map2.put("sex", "1");

        list.add(map1);
        list.add(map2);

        model.addAttribute("list",list);

        return "userList";

    }
}
